<html>
<head><title>Evolve a Phrase</title></head>
<body>
<h1>Evolving a Phrase</h1>
<p>One classic example of artificial evolution is evolving a
phrase. What are the chances that a certain phrase would be created by
essentially random forces if we just put letters together? Pretty
lousy; if we just used lowercase letters, the chances of randomly
assembling the phrase, "i am a banana" are one in
4052555153018976267. When faced with such ludicrous odds, how could
simulated evolution possibly produce such a thing?</p>

<p>The answer is that evolution is not random. Mutation is random, but
natural selection is not. Natural selection chooses the best of the
crop to pass on their genetic information, which is then mutated.</p>

<p>Suppose that we try this on phrases. We start out with the phrase 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
and create twenty mutated descendants. Specifically, the chance of any
letter being randomly changed is 5%, although this could be changed
without any bad results. We pick the best of each generation, the one
with the most letters correct, and produce another generation of
twenty slightly mutated versions of it. Continue this for a few
generations, and what do you get?</p>

<p>Here's our first generation:

<pre>
"           a " "H            " "             " "     q       "
"             " "             " "K            " "             "
"             " "   f         " "             " " C   w       "
"             " "             " " J          x" "  r      e   "
"             " "       rz    " "P i     a    " "             "
</pre>

Doesn't look like much, does it? How about our second generation:

<pre>
"PCi     ae   " "P?i   f a    " "P i     a    " "PLi u   a    "
"P i     a    " "P i     b    " "P i     a    " "P i     e    "
"P i     a    " "P i     a    " "P i  z  a    " "P i     a  O "
"r i     a    " "P i a   a    " "P i     a    " "P i    ja    "
"P i     a    " "Pbi     a r  " "Pxi     w    " "P ik    a    "
</pre>

It still sucks! It sure looks random. Let's turn the clock forward
fourty generations, now:

<pre>
"P aO a qacan " "P aO a qacanC" "P aOla qacan " "P aO a qacan "
"P aO a qacan " "PoaO a qacan " "PuaO a qacan " "P aO x qacan "
"P gO a qacan " "P aO a qacan " "P aOha qacan " "P aO a qacan "
"P aa a qacan " "P aO a qacar " "P aO a qacan " "x aO a qacan "
"P aO aeqacan " "P aO a qacan " "P aO a qacan " "P aO a qacan "
</pre>

It's starting to look like an actual attempt to write something by
someone with a disease that seriously impairs motor skills! Let's turn
on fast forward and skip ahead a whole 100 generations:

<pre>
"t am a uacana" "t am a uacana" "t am a uacana" "t am a uacana"
"t am a uacana" "t am a uacana" "t am a uacana" "t am a uacana"
"t am a uacana" "t am a uacana" "t am a uicaoa" "t am a uacana"
"t am ayuacana" "tyam awuacana" "f am a iacana" "t am a uavana"
"t am aouacana" "t am a uacana" "t am a nacana" "t am a uacana"
</pre>

That's still pretty pathetic, but it's far from purely random. The
best in there is "t am a uacana", which isn't that far from "I am a
banana". Let's really pour on the gas and go forward 1000 generations:

<pre>
"I am j banana" "I am a banana" "I am aPbanana" "I am a brnaua"
"I am a banana" "Iaam a banana" "I am a baeana" "p am a banana"
"I am a banana" "I am a baiana" "I am anbanana" "I am a baLa a"
"I am a banana" "I am a banana" "I am a banana" "I am a banana"
"I am a banajk" "I am a banaua" "I am a banana" "I am a banana"
</pre>

Isn't that great? The best one there is actually the phrase "I am a
banana". We've succeeded in creating something that looks
intelligently designed through evolution. I, the intelligent designer,
merely specified that the process would approximate evolution and that
the closer the phrase was to "I am a banana", the better it was. Once
I started it evolving, I had no further input.</p>

<p>Similar experiemts have produced entire plays by Shakespeare in a few
days. Is it any wonder that evolution can produce apparent
miracles?</p>
</body>
</html>